package com.example.annoation.redis;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Caching;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2020/9/26 14:56
 */
@Caching(
        put = {
                @CachePut(value = "test", key = "#test.id"),
        },
        evict={
                @CacheEvict(value = "test", key = "#test.code"),
        }
)
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface CustomCache {

}
